---
title: "Legacy Themes: Customising the Header"
---

Style grid [header](./column-headers/) cells and column groups.

{% note %}
This page describes the grid's legacy theming system that was the default in v32 and before, for the benefit of applications that have not yet migrated to the Theming API. These themes are deprecated and will be removed in a future major version. You may want to visit the [new theming docs](./theming-headers/) or check out the [migration guide](./theming-migration/).
{% /note %}

The grid exposes many CSS variables starting `--ag-header-*` for customising header appearance, and when these are not enough you can use CSS classes, in particular `ag-header`, `ag-header-cell`, and `ag-header-group-cell`:

```css
.ag-theme-quartz {
    --ag-header-height: 30px;
    --ag-header-foreground-color: white;
    --ag-header-background-color: black;
    --ag-header-cell-hover-background-color: rgb(80, 40, 140);
    --ag-header-cell-moving-background-color: rgb(80, 40, 140);
}
.ag-theme-quartz .ag-header {
    font-family: cursive;
}
.ag-theme-quartz .ag-header-group-cell {
    font-weight: normal;
    font-size: 22px;
}
.ag-theme-quartz .ag-header-cell {
    font-size: 18px;
}
```

{% gridExampleRunner title="Colour Customisation" name="header-customisation"  exampleHeight=400 /%}

## Header Column Separators and Resize Handles

Header Column Separators appear between every column, whereas Resize Handles only appear on resizeable columns (Group 1 in the example below).

```css
.ag-theme-quartz {
    --ag-header-column-separator-display: block;
    --ag-header-column-separator-height: 100%;
    --ag-header-column-separator-width: 2px;
    --ag-header-column-separator-color: purple;

    --ag-header-column-resize-handle-display: block;
    --ag-header-column-resize-handle-height: 25%;
    --ag-header-column-resize-handle-width: 5px;
    --ag-header-column-resize-handle-color: orange;
}
```

{% gridExampleRunner title="Column Separators" name="header-customisation-columns"  exampleHeight=400 /%}

## Style Header on Filter

Each time a [Column Filter](./filtering/) is applied to a column, the CSS class `ag-header-cell-filtered` is added to the header. This can be used for adding style to headers that are filtered.

The example below adds some styling to `ag-header-cell-filtered`, so when you filter a column you will notice the column header change.

{% gridExampleRunner title="Style Header" name="style-header-on-filter"  exampleHeight=520 /%}

## Styling the First and Last Columns

It's possible to style the all first and last column header (Grouped, Non-Grouped and Floating Filters) using CSS by targeting the `.ag-column-first` and `.ag-column-last` selectors as follows:

```css
.ag-header-group-cell.ag-column-first {
    background-color: #2244CC66;
    color: white;
}
.ag-header-cell.ag-column-first {
    background-color: #2244CC44;
    color: white;
}
.ag-floating-filter.ag-column-first {
    background-color: #2244CC22;
}

.ag-header-group-cell.ag-column-last {
    background-color: #33CC3366;
}
.ag-header-cell.ag-column-last {
    background-color: #33CC3344;
}
.ag-floating-filter.ag-column-last {
    background-color: #33CC3322;
}
```

{% gridExampleRunner title="Style Header" name="style-header-first-last"  exampleHeight=520 /%}

## Full List of Header Variables

{% apiDocumentation source="global-style-customisation-variables/variables.json" section="variables" config={"namePattern": "--ag-header", "hideHeader": true} /%}
